<?php
ob_start();
header('Content-type:text/html; charset=utf-8');
$g4_path = '..';
set_include_path(get_include_path().PATH_SEPARATOR.$g4_path."/lib");
$lib =  "$g4_path/lib.php";
require_once ("$g4_path/common.php");
require_once ($lib);
require_once ('Template_.class.php');
if(!$_SESSION['ss_mb_id'] && !strstr($_SERVER['PHP_SELF'], 'index')) {
    goto_url('/admin');
} else if($_SESSION['ss_mb_id']) {
   $mb_id = $_SESSION['ss_mb_id'];
   list($division) =  mysql_fetch_row(mysql_query("SELECT mb_division FROM g4_member WHERE mb_id = '$mb_id'"));
   if($division != '일반관리자' && $division != '최고관리자' && strstr($_SERVER['PHP_SELF'], 'index')) {
        if($division == "강사") {
            goto_url('../teacher'); 
        }
        goto_url('/');
   }
}

if(strstr($_SERVER['PHP_SELF'],'super') && $division != '최고관리자' ) {
        alert('권한이 없습니다');
}
mysql_query('SET NAMES UTF8');
//error_reporting(E_ALL & E_NOTICE);
$backgrounds = array('#ff8100','#ff9600', '#feb100', '#ffcc00', '#feb100', '#ba0000');
$images = array('sub_img_company.gif','sub_img_business.gif','sub_img_product.gif', 'sub_img_friend.gif', 'sub_img_product.gif','sub_img_mypage.gif');
$background = $backgrounds[$menu];
$mainImage = $images[$menu];
$tpl = new Template_;
$tpl->template_dir = './tpl';
$tpl->compile_dir = './tpl/compile';
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo $title?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="office.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/prototype.js"></script>
<script type="text/javascript" src="./lib.js"></script>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="146" valign="top" background="images/sub_bg_menu.gif"><table width="146" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td width="146" height="48" bgcolor="#FFFFFF"><img src="images/1blank.gif" width="1" height="1"><a name="top"></a></td>
              </tr>
              <tr> 
               <?php if(strstr($_SERVER['PHP_SELF'], 'index')) :?>
                <td><img src="images/main_left_title.gif" border="0"></td>
                <?php else:?>
                <td><img src="images/sub_img.gif" border="0"></td>
                <?php endif;?>
              </tr>
            </table>
          </td>
          <td valign="top"> 
            <table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/sub_bg.gif">
              <tr> 
                <td><table width="823" height="48" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                          <tr> 
                            <td width="95" valign="top"><a href="members.php"><img src="images/main_menu_01.gif" name="menu011" width="79" height="25" border="0" id="menu01"></a></td>
                            <td width="94" valign="top"><a href="teacher.php?add"><img src="images/main_menu_02.gif" name="menu021" width="78" height="25" border="0" id="menu02"></a></td>
                            <td width="148" valign="top"><a href="courseOrders.php"><img src="images/main_menu_03.gif" name="menu031" width="132" height="25" border="0" id="menu03"></a></td>
                            <td width="91" valign="top"><a href="teacherCourseManage.php"><img src="images/main_menu_04.gif" name="menu041" width="75" height="25" border="0" id="menu04"></a></td>
                            <td width="70" valign="top"><a href="../adm/"><img src="images/main_menu_05.gif" name="menu051" width="92" height="25" border="0" id="menu05"></a></td>
                      <td valign="top"><img src="images/1blank.gif" width="1" height="1"></td>
                            <td width="75"><img src="images/1blank.gif" width="1" height="1"></td>
                            
                      <td width="85"><a href="superCourseEval.php"><img src="images/main_but_office.gif" alt="" name="login11" width="77" height="16" border="0" id="login"></a></td>
                            <td width="67"><a href="./logout.php"><img src="images/main_but_out.gif" alt="" name="login1" width="58" height="16" border="0" id="login2"></a></td>
                    </tr>
                        </table></td>
              </tr>
              <tr> 
            <?php //require_once "topMenu.html";
            if (strstr($_SERVER['PHP_SELF'], 'index')) :
            ?>
                <td height="170" style="background:url('images/main_img_bg.gif') 0 -48px repeat-x;"><img width="263" height="170" border="0" alt="" src="images/login_home.gif"/></td>
            
            <?php else : ?>
                <td bgcolor="<?php echo $background?>"><table width="823" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td width="823"><img src="images/<?php echo $mainImage?>" height="103"></td>
                   </tr>
                  </table></td>

 <?php endif; ?>
              </tr>
              <tr> 
                <td height="18">
